<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<body>
<div id="app">
    <el-table :data="tableData" stripe>
        <el-table-column prop="date" label="日期"></el-table-column>
        <el-table-column prop="name" label="姓名"></el-table-column>
        <el-table-column prop="address" label="地址"></el-table-column>
        <el-table-column label="操作" align="center">
            <template slot-scope="scope">
                <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
                <el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
            </template>
        </el-table-column>
    </el-table>
</div>

<script>
    new Vue({
        el: "#app",
        data:{
            tableData:[
                {date:"2018",name:"张三",address:"北京黑马"},
                {date:"2019",name:"李四",address:"郑州黑马"},
                {date:"2020",name:"王五",address:"杭州黑马"},
            ]
        },
        methods:{
            handleUpdate(row) {
                alert(row.name);
            },
            handleDelete(row) {
                alert(row.date);
            }
        }

    })

</script>

</body>
</html>